<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
	//分页跳转页面是,根据查询条件去查询分页
	function pagSearch(url,id){
		var param = $('#'+id).serialize();
		url = url+"&"+param;
		window.location.href = url;
	}
</script>

<div class="page mt10">
  <div class="pagination">
    <ul>
        <li class="first-child"><a href="javascript:pagSearch('${root }${reqUrl}?page=1','searchForm')">首页</a></li>
        <li class="disabled">
       		<c:choose>
       			<c:when test="${pageView.currentpage > 1}">
       				<a href="javascript:pagSearch('${root }${reqUrl}?page=${pageView.currentpage - 1}','searchForm')">上一页</a>
       			</c:when>
       			<c:otherwise>
       				<a>上一页</a>
       			</c:otherwise>
       		</c:choose>
        </li>
        <c:forEach begin="${pageView.pageindex.startindex}" end="${pageView.pageindex.endindex}" var="wp">
        <c:if test="${pageView.currentpage==wp}"><li class="active"><span >${wp }</span></li></c:if>
        <c:if test="${pageView.currentpage!=wp}"><li><a href="javascript:pagSearch('${root }${reqUrl}?page=${wp }','searchForm')">${wp }</a></li></c:if>
        </c:forEach>
        <li>
       		<c:choose>
       			<c:when test="${pageView.currentpage < pageView.totalpage}">
       				<a href="javascript:pagSearch('${root }${reqUrl}?page=${pageView.currentpage + 1}','searchForm')">下一页</a>
       			</c:when>
       			<c:otherwise>
       				<a >下一页</a>
       			</c:otherwise>
       		</c:choose>
        </li>
        <li class="last-child">
        	<c:if test="${pageView.totalpage > 0 }">
        		<a href="javascript:pagSearch('${root }${reqUrl}?page=${pageView.totalpage}','searchForm')">末页</a>
        	</c:if>
        	<c:if test="${pageView.totalpage == 0 }">
        		<a href="javascript:pagSearch('${root }${reqUrl}?page=1','searchForm')">末页</a>
        	</c:if>
        </li>
    </ul>
  </div>
</div>